package reports

import "yundian/internel/pkg/dingo"

// --------------------------- 设置默认初始值 ------------------------- //

type ReportAttr func(model *ReportsModel)

type ReportAttrs []ReportAttr

func (attrFunc ReportAttrs) Apply(m *ReportsModel) {
	for _, f := range attrFunc {
		f(m)
	}
}

func WithMemberId(memberId int) ReportAttr {
	return func(m *ReportsModel) { m.MemberId = memberId }
}

func WithDeviceSn(deviceSn string) ReportAttr {
	return func(m *ReportsModel) { m.DeviceSn = deviceSn }
}

func WithTradeNo(tradeNo string) ReportAttr {
	return func(m *ReportsModel) { m.TradeNo = tradeNo }
}

func WithStatus(status int8) ReportAttr {
	return func(m *ReportsModel) { m.Status = status }
}

func WithCreateAt(createAt dingo.Time) ReportAttr {
	return func(m *ReportsModel) { m.CreateAt = createAt }
}

func WithUpdateAt(updateAt dingo.Time) ReportAttr {
	return func(m *ReportsModel) { m.UpdateAt = updateAt }
}